#ifndef _PMAC_H_
#define _PMAC_H_

#define DRIVERNAME TEXT("PComm32W.dll") //name of the user-dll driver
//*****************************************************************
// COMM Type Defines
//*****************************************************************
//
//	The only difference between the two sets of functions is the return value. The extended routines provide
//	error status (in the most significant byte) in addition to the number of characters received (all other bytes),
//	whereas the non-Ex routines simply return the number of characters received from PMAC.
//

//opens a channel for the program to use the PMAC driver
typedef BOOL (CALLBACK* OpenPmacDevice)(DWORD dwDevice);

//This function closes the channel from your program to the PMAC driver.
typedef BOOL (CALLBACK* ClosePmacDevice)(DWORD dwDevice);

//Provides a way to select and configure currently installed PMAC Devices
typedef long (CALLBACK* PmacSelect)( HWND hwnd );

//To communicate to PMAC (via ASCII communication), uninterrupted by other threads or applications,
//use LockPmac() and ReleasePmac() routines for these instances.
typedef void (CALLBACK* LockPmac)(DWORD dwDevice);
typedef void (CALLBACK* ReleasePmac)(DWORD dwDevice);

//Most if not all of the communication with the PMAC can be handled with the PmacGetResponseA() function.
typedef long (CALLBACK* PmacGetResponseExA)(DWORD dwDevice,PCHAR response,UINT maxchar,PCHAR command);


typedef void (FAR WINAPI *DOWNLOADMSGPROC)(LPTSTR str, BOOL newline);

typedef long (FAR WINAPI *DOWNLOADGETPROC)(long nIndex, LPTSTR lpszBuffer, long nMaxLength);

typedef long (FAR WINAPI *DOWNLOADPROGRESS)(long nPercent);

typedef long (CALLBACK* PmacDownloadA)(DWORD dwDevice, DOWNLOADMSGPROC msgp, DOWNLOADGETPROC getp,
									   DOWNLOADPROGRESS pprg, PCHAR filename, BOOL macro, BOOL map,
									   BOOL log, BOOL dnld);

#endif